Mega Code Archive

Categories
1) Android
2) ASP.Net
3) ASP.Net Tutorial
4) C
5) C Tutorial
6) C#
7) C# Book
8) C# by API
9) C# Tutorial
10) C++
11) C++ Tutorial
12) Delphi
13) Flash ActionScript
14) Flex
15) Java
16) Java Book
17) Java by API
18) Java Tutorial
19) JavaScript DHTML
20) JavaScript Reference
21) JavaScript Tutorial
22) MSOfficeExcel 2007 Tutorial
23) MSOfficePowerPoint 2007 Tutorial
24) MSOfficeWord 2007 Tutorial
25) MSSQL
26) MSSQL Tutorial
27) MySQL
28) MySQL Tutorial
29) Oracle PLSQL
30) Oracle PLSQL Tutorial
31) Perl
32) Php
33) PostgreSQL
34) Python
35) Python Tutorial
36) Ruby
37) Silverlight
38) VB.Net
39) VB.Net by API
40) VB.Net Tutorial
41) Visual C++ .NET
42) VisualBasic Script
43) XML
44) XML Tutorial
 
Ruby
1) Active Record
2) Array
3) CGI
4) Class
5) Collections
6) Database
7) Date
8) Design Patterns
9) Development
10) File Directory
11) GUI
12) Hash
13) Language Basics
14) Method
15) Network
16) Number
17) Rails
18) Range
19) Reflection
20) Statement
21) String
22) Threads
23) Time
24) Tk
25) Unit Test
26) Windows Platform
27) XML
Reflection
1) Add a new method with module_eval
2) Add method to an instance
3) Binding creates a new Method object
4) Bindings
5) Call ancestors on a class name to see its inheritance hierarchy, like this
6) Call remove_const to remove a class definition
7) Check respond_to for new added instance method
8) Check respond_to for new added singleton method
9) Check the object_id before and after replace
10) Check the object_id before and after the assignment
11) Class attribute of string instance
12) Class obj says build me a new class just for object obj
13) Class_eval is ideal for adding methods to a class dynamically
14) Convert all system command to all class method
15) Create a new class and override the method_missing method
16) Create new method dynamically
17) Creating Your Own Version of attr_accessor
18) Determine our objects class and its unique objectID and test its relationship to other classes
19) Discover the names of any of the included modules of an instance or its class using the included_modules method from Module
20) Dynamic Code Execution
21) Each object has its own numeric object ID
22) Find all instance methods of Fixnum that take 2 arguments
23) Find out the singleton_methods
24) Generating and Understanding Tracebacks
25) Get ancestors
26) Get caller line number
27) Get class and superclass
28) Get superclass
29) Get the size of public methods
30) Getting a Reference to a Method
31) If an object is an instance of a given class with the instance_of method from Object
32) If method does not exist, call the default one
33) Inquire after instance methods with a method from Module
34) Instance_variable_set and get
35) Is instance method defined
36) Is it a number
37) Is it a string class instance
38) Kernels method global_variables returns all the global variables, including $ship
39) Listen to extension action
40) Listen to inheritance action
41) Listening for Changes to a Class
42) Listing Methods Unique to an Object
43) Look at an objects ancestors with Modules ancestors method, which returns a list of both classes and modules
44) Look at the objects constants,local, and instance variables
45) Make new private
46) Method instance_variables returns the names of any instance variables associated with an instance (as opposed to class variable
47) Method pointer
48) Object class_variable_set and get
49) Object has a super class in Ruby 1 9
50) Object_id is not changing
51) ObjectSpace each_object
52) Override method_missing method to provide meaningful error message
53) Print out all exceptions
54) Print out only errors
55) Protected_methods
56) Public_methods
57) Query about methods with the Object methods private_methods
58) Query almost any object within Ruby for the methods that are defined within it
59) Reflection and Metaprogramming Introduction
60) Reflection on Methods
61) Responding to Calls to Undefined Methods
62) Return the instance variables with Objects instance_variables
63) Return value based on parameter type
64) Singleton_methods
65) Sort all method from Object
66) String private_instance_methods sort
67) Testing Whether an Object Is String-like
68) The class method supercedes Objects deprecated method type, or gets the name of the class as a string with the name method
69) The keyword __FILE__ stands for the name of the file containing the code
70) The method respond_to tests to see whether an instance of Address has access to
71) The Object class has a class method that returns the name of an instances class
72) The respond_to method from Object checks to see if a given object responds to a given method
73) To determine the name of the superclass
74) Trace function
75) Unlike instance_of, is_of or kind_of also work if the argument is a superclass or module
76) Use === to check the class type
77) Use instance_eval to execute code within the scope of an object
78) Use instance_of for robustness
79) Use is_a to check the class type
80) Use Kernels local_variables method
81) Use module_eval to create dynamic method
82) Use Objects is_a or kind_of methods (they are synonyms)
83) Use singleton_method_added to call a singleton method
84) Use the included_modules method to discover what modules a class uses
85) Uses strings and interpolation with Dynamic Code Execution
86) Want to know what constants the Object class (or some other class) has Use the constants method from Module (output is truncate